package com.wdzl.dao;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.wdzl.db.DBManager;

public class UserDao extends DBManager {
	public boolean login(String uname,String upass){
		String sql = "select upass from userTbl where uname=?";
		String[] data = {uname};
		ResultSet rst = super.query(sql, data);
		try {
			if(rst.next()){
				String dbpass = rst.getString("upass");//数据库中的密码
				if(dbpass!=null && dbpass.equals(upass)){//匹配密码
					return true;
				}
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return false;
	}
}
